package com.ly.lypicturebackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ly.lypicturebackend.model.dto.space.SpaceAddRequest;
import com.ly.lypicturebackend.model.dto.space.SpaceQueryRequest;
import com.ly.lypicturebackend.model.entity.Space;
import com.ly.lypicturebackend.model.entity.User;
import com.ly.lypicturebackend.model.vo.SpaceVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author zzz
* @description 针对表【space(空间)】的数据库操作Service
* @createDate 2025-02-21 13:01:32
*/
public interface SpaceService extends IService<Space> {
    /**
     * 获取查询条件
     */
    QueryWrapper<Space> getQueryWrapper(SpaceQueryRequest spaceQueryRequest);

    /**
     * 获取空间封装类
     * @param space 空间
     * @return spaceVo
     */
    SpaceVO getSpaceVO(Space space, HttpServletRequest request);

    /**
     * 获取空间分页封装类
     */
    Page<SpaceVO> getSpaceVOPage(Page<Space> spacePage, HttpServletRequest request);

    void validSpace(Space space, boolean add);

    void fillSpaceBySpaceLevel(Space space);

    long addSpace(SpaceAddRequest spaceAddRequest, User loginUser);

// 检查用户是否有权限访问指定空间
    void checkSpaceAuth(Space space, User loginUser);
}
